﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MuiManager.aspx.cs" Inherits="ISolutions.SharePoint.Mui.Layouts.ISolutions.SharePoint.Mui.MuiManager"
    DynamicMasterPageFile="~masterurl/default.master" %>

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
</asp:Content>
<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <script language="javascript">
        function OpenResDialog(resourcekey) {
            var options = {
                url: SP.Utilities.Utility.getLayoutsPageUrl('ISolutions.SharePoint.Mui/EditResource.aspx?Res=' + resourcekey + '&Source=' + location.href),
                title: 'Edit MUI Resource',
                width: 640,
                height: 400,
                showClose: true,
                dialogReturnValueCallback: Function.createDelegate(null, function (result, returnValue) {
                    if (result == SP.UI.DialogResult.OK) {
                        if (returnValue == null) {
                            SP.UI.Notify.addNotification('Operation successful');
                            SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK);
                        }
                        else {
                            location.href = returnValue;
                        }
                    }
                })
            }

            SP.UI.ModalDialog.showModalDialog(options);
        }
    </script>
    <SharePoint:SPGridView runat="server" ID="gridResources" AllowSorting="true" AllowFiltering="true"
        AutoGenerateColumns="false">
        <Columns>
            <asp:TemplateField HeaderText="Edit">
                <ItemTemplate>
                    <a href='javascript:OpenResDialog("<%# Eval("Key")%>")'> 
                        Edit                        
                    </a>
                </ItemTemplate>
            </asp:TemplateField>
            <SharePoint:SPBoundField DataField="Key" />
        </Columns>
    </SharePoint:SPGridView>
</asp:Content>
<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
    SharePoint MUI Manager
</asp:Content>
<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea"
    runat="server">
    SharePoint MUI Manager
</asp:Content>
